import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:riverpod_t/routers/navigator_utils.dart';
import 'package:riverpod_t/routers/routers.dart';

class MineNavigator {
  MineNavigator._();

  static Future toMyCenter(BuildContext context, {int? userId}) {
    return NavigatorUtils.push(context, _MineRoutes.myCenterPage,
        replace: false, clearStack: false, arguments: {'userId': userId});
  }

  static ModuleRouter getRouter() {
    return _MineRoutes();
  }
}

class _MineRoutes extends ModuleRouter {
  static const myCenterPage = '/page/mine/page/MyCenterPage';

  @override
  void init(FluroRouter router) {
    // router.define(myCenterPage, handler: Handler(handlerFunc: (context, params) {
    //   Map? argument = context!.settings!.arguments as Map?;
    //   int? userId = argument?['userId'] ?? 0;
    //   return MultiBlocProvider(providers: [
    //     BlocProvider(create: (context) => MyCenterPageCubit()),
    //     BlocProvider(create: (context) => AccountCubit())
    //   ], child: MyCenterPage(userID: userId));
    // }));
  }
}
